package io.geekidea.boot.outbound.service.Impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.geekidea.boot.outbound.dto.OutboundExcel;
import io.geekidea.boot.outbound.entity.Outbound;
import io.geekidea.boot.outbound.mapper.OutboundMapper;
import io.geekidea.boot.outbound.query.OutboundQuery;
import io.geekidea.boot.outbound.service.OutboundService;
import io.geekidea.boot.warehousentry.dto.StatisticsDto;
import io.geekidea.boot.warehousentry.query.WarehousentryQuery;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor = Exception.class)
public class OutboundServiceImpl extends ServiceImpl<OutboundMapper, Outbound> implements OutboundService {

    @Resource
    OutboundMapper outboundMapper;
    @Override
    public Page<Outbound> getOutboundPageList(Page<Outbound> page, OutboundQuery outboundQuery) {
        return outboundMapper.getOutboundPageList(page,outboundQuery);
    }

    @Override
    public int delById(Integer id) {
        return baseMapper.delById(id);
    }

    @Override
    public List<OutboundExcel> getDownloadList(OutboundQuery outboundQuery) {
        return outboundMapper.getDownloadList(outboundQuery);
    }

    @Override
    public int getSingularCount(WarehousentryQuery warehousentryQuery) {
        return outboundMapper.getSingularCount(warehousentryQuery);
    }

    @Override
    public List<StatisticsDto> getWeekCount(WarehousentryQuery warehousentryQuery) {
        return outboundMapper.getWeekCount(warehousentryQuery);
    }
}
